﻿// 1.1.7.15. Write a program, which creates an array containing all Latin letters. The user inputs a word
// from the console and as result the program prints to the console the indices of the letters from the word.

using System;

class IndicesOfLettersByAWord
{
    static void Main()
    {
        // fill aray with small and LeadCase letters
        char firstCapital = 'A';
        char firstMinuscule = 'a';
        char[] letterIndices = new char[26 * 2];
        for (int i = 0; i < 26; i++)
        {
            letterIndices[i] = firstCapital++; 
        }
        for (int i = 26; i < 26 * 2; i++)
        {
            letterIndices[i] = firstMinuscule++;
        }

        //Console.WriteLine(letterIndices[0]);
        //Console.WriteLine(letterIndices[25]);
        //Console.WriteLine(letterIndices[26]);
        //Console.WriteLine(letterIndices[26 * 2 - 1]);
        //Console.WriteLine((int)'a'); // 97
        //Console.WriteLine((int)'A'); // 65


        // filling a char array with every char from a word
        string word = "ABCZabcz"; // string word = Console.ReadLine();
        char[] wordChars = new char[word.Length]; wordChars = word.ToCharArray();

        //Console.WriteLine(word.Length);


        // printing with foreach for each letter indexOF
        foreach (var letter in wordChars)
        {
            Console.WriteLine(Array.IndexOf(letterIndices, letter));
        }
    }
}